--- Introduction ---
Hello,
I have been making a lot of video and audio players in VB the last few
years but have never really finished any of them. This is because I am
much more interensted in the technique behind it all, than the design
and interface crap.
This is why I made this control. It simplifies playing video and audio
files from hard to easy. So easy that any starting programmer that knows
how to add extra controls can use it. ;-)

Alex.


--- How to use ---
First you need to install the control: Right-click on the .ocx file and
select: Register control. That is all.
Then to add this control to your program, you should Right-click your
control-bar on the left and select 'MediaPlayer by aiJX.com' then you can
add the control to your program by double-clicking the new icon that
appeared in the Control-box.
Now you can use MediaPLayer to play as many files as you like. Even at
the same time. As I said earlier, using this control is very simple, also
everything is commented, just to make sure you won't be left behind with 
many questions on your mind.

There are just three things a little more difficult, so read the following
carefully:

1. You can specify different files by using aliases. These aliases are
   used to control a file. I have made the control alias-based so that
   multiple files can be played at once. Like this:

   With MPlay1
       .OpenFile "OneFile", "C:\FileOne.mp3", Me.hWnd
       .OpenFile "AnotherFile", "C:\FileTwo.mp3", Me.Hwnd
       .PlayFile "OneFile"
       .PlayFile "AnotherFile"
   End With

2. All functions will return 0 if the operation was executed without a
   a problem. If a number other than zero is returned there has been an
   error. Then you can use ErrorMsg to get more infomation on the error.
   This can be done this way:

   With MPlay1
       lError = .PlayFile("SomeFile")
       If lError Then MsgBox .ErrorMsg lError
   End With

   If an error occurs with properties that return numbers (such as Volume
   and Duration) the error will be returned as a negative number.
   These negative numbers can be used with ErrorMsg as well:

   With MPlay1
       lLength = .Duration("SomeFile")
       If lLength < 0 Then MsgBox .ErrorMsg lLength
   End With

3. On more thing you should know that you'll have to use the OpenFile-
   function before you can actually do anything with a file.

The rest is as easy as pie. Yet still everything is being explained below,
so that no unanswered questions remain.


--- Contact ---
If you are using this control in one of your programs, I'd like it very much
if you could mention me somewhere. At least, I expect to recieve a copy of your
software once it's finished! Just as a way of saying 'thank you' ;-)
Anyway, feel free to email me, if you have any questions or problems whatsoever.

Have fun,
Alex.

Alex Smakman, Holland.
Email: A.R.Smakman@umail.LeidenUniv.nl


-----------------------------------------------------------------------------------


Here is a little explanation of what all functions do and all the variable mean,
read this if you can't figure out how something works with the control.

+-----------+
|  Actions  |
+-----------+

### OpenFile ###
    
This module opens a file, but doesn't play it yet, but you must call
this function before PlayFile to specify the file you want to play
and where to play it. Also it creates the alias for Windows.
    
--- Properties ---
Alias           See top of this file: 'How to use'.
Filename        Path and filename of the mediafile you want to open.
hWnd            The hWnd property of what control you wish to play your
                file in, when playing audio files you can simply use the
                form's hWnd (Me.Hwnd), but you can also use a PictureBox
                when playing video files.
OpenInNewWindow There is a very basic player within Windows, just try it
                and then don't use it. :-)
    

### PlayFile ###

After using the OpenFile-function you can play a file using PlayFile.
If you'd like to play a passage from a file you can specify FromTime
and ToTime, which will make the part between these times play.
If FromTime hasn't been specified the file will play from the beginning
and if ToTime han't been specified the file will be played to the end.
So if neither has been specified the file will play completely.
That's not so hard to understand, now is it?
    
--- Properties ---
FromTime        See above. FromTime must be specified in milliseconds.
ToTime          See above. ToTime must be specified in milliseconds.
                So, if you'd want to play a file's 2nd minute you should
                do this: PlayFile 60000, 120000
    

### PauseFile ###
    
Pauses playback of the file, use ResumeFile to resume playback.


### ResumeFile ###
    
Resumes playback after the file has been pause with PauseFile.
    

### StopFile ###
    
Stops playback of the file.
    

### CloseFile ###
    
Closes file, you need to use the OpenFile function to play the file again.
    

+------------+
|  Settings  |
+------------+

### SetPosition ###

Go to the (with Position) specified position of the file. The
boundries given with PlayFile are still valid after seeking.
    
--- Properties ---
Position        Go to this position (in milliseconds) of the file.


### SetDimentions ###
    
When you are playing a video you can change the size and place of the
video screen using this function. All values are in pixels.
    
--- Properties ---
Left            The left of the video in pixels (This is zeroed at the
                left border of the control you play the video in.)
Top             The top of the video in pixels.
Width           Width of the video in pixels.
Heigth          Height of the video in pixels. (I bet you didn't expect
                that, now did you? ;-) 


### SetVolume ###

This will set the volume for both left and right channel.
It is a linear scale ranging from 0 for silence to 1000 for
full volume.
    
--- Properties ---
Volume          Set the volume for both channels to this value.


### SetVolumeLeft ###

This will set the volume for the left audio channel.
It is a linear scale ranging from 0 for silence to 1000 for
full volume.
    
--- Properties ---
Volume          Set the volume for the left channel to this value.


### SetVolumeRight ###, Volume As Long) As Long

This will set the volume for the right audio channel.
It is a linear scale ranging from 0 for silence to 1000 for
full volume.
    
--- Properties ---
Volume          Set the volume for the right channel to this value.


+----------+
|  Values  |
+----------+

### ErrorMsg ###
    
Use this function is one of the other functions returns an error code.
For further explanation see top of this file: 'How to use'
    
--- Properties ---
Error ID        The error code you get returned when a function fails.


### Duration ###
    
Returns the duration of the file in milliseconds.
! Negative error will be returned (see top of document: 'How to use') 
    

### Position ###
    
Returns the current position of the playback in milliseconds.
! Negative error will be returned (see top of document: 'How to use') 
    

### Status ###
    
Returns the status of the file i.e. playing, paused or stopped.
! This will return the number of the error as a string. Use the CLng-
  command to enter the string into the ErrorMsg-function.
    

### Dimentions ###

Returns the dimentions as child-values. You will have to use:
MPlay1.Dimentions("Alias").Left to get the values for the video's left.
The Error-child will return the error number if something went wrong,
if everything went ok, it will return zero.


### Volume ###
    
Returns the avarage volume of the left ans right channel. Doesn't
always give the correct average though. Rages from 0 to 1000,
0 being silent, 1000 being the full volume.
! Negative error will be returned (see top of document: 'How to use') 
    

### VolumeLeft ###
    
Returns the volume of the left channel. Ranges from 0 to 1000.
! Negative error will be returned (see top of document: 'How to use') 
    

### VolumeRight ###
    
Returns the volume of the right channel. Ranges from 0 to 1000.
! Negative error will be returned (see top of document: 'How to use')